<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
	<title>Voting configuration exclusions API | ElasticSearch 7.7 权威指南中文版</title>
	<meta name="keywords" content="ElasticSearch 权威指南中文版, elasticsearch 7, es7, 实时数据分析，实时数据检索" />
    <meta name="description" content="ElasticSearch 权威指南中文版, elasticsearch 7, es7, 实时数据分析，实时数据检索" />
    <!-- Give IE8 a fighting chance -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
	<link rel="stylesheet" type="text/css" href="../static/styles.css" />
	<script>
	var _link = 'voting-config-exclusions.html';
    </script>
</head>
<body>
<div class="main-container">
    <section id="content">
        <div class="content-wrapper">
            <section id="guide" lang="zh_cn">
                <div class="container">
                    <div class="row">
                        <div class="col-xs-12 col-sm-8 col-md-8 guide-section">
                            <div style="color:gray; word-break: break-all; font-size:12px;">原英文版地址: <a href="https://www.elastic.co/guide/en/elasticsearch/reference/7.7/voting-config-exclusions.html" rel="nofollow" target="_blank">https://www.elastic.co/guide/en/elasticsearch/reference/7.7/voting-config-exclusions.html</a>, 原文档版权归 www.elastic.co 所有<br/>本地英文版地址: <a href="../en/voting-config-exclusions.html" rel="nofollow" target="_blank">../en/voting-config-exclusions.html</a></div>
                        <!-- start body -->
                  <div class="page_header">
<strong>重要</strong>: 此版本不会发布额外的bug修复或文档更新。最新信息请参考 <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html" rel="nofollow">当前版本文档</a>。
</div>
<div id="content">
<div class="breadcrumbs">
<span class="breadcrumb-link"><a href="index.html">Elasticsearch Guide [7.7]</a></span>
»
<span class="breadcrumb-link"><a href="rest-apis.html">REST APIs</a></span>
»
<span class="breadcrumb-link"><a href="cluster.html">Cluster APIs</a></span>
»
<span class="breadcrumb-node">Voting configuration exclusions API</span>
</div>
<div class="navheader">
<span class="prev">
<a href="tasks.html">« Task management API</a>
</span>
<span class="next">
<a href="ccr-apis.html">Cross-cluster replication APIs »</a>
</span>
</div>
<div class="section">
<div class="titlepage"><div><div>
<h2 class="title">
<a id="voting-config-exclusions"></a>Voting configuration exclusions API<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/cluster/voting-exclusions.asciidoc">edit</a>
</h2>
</div></div></div>

<p>Adds or removes master-eligible nodes from the
<a class="xref" href="modules-discovery-voting.html" title="Voting configurations">voting configuration exclusion list</a>.</p>
<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="voting-config-exclusions-api-request"></a>Request<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/cluster/voting-exclusions.asciidoc">edit</a>
</h3>
</div></div></div>
<p><code class="literal">POST _cluster/voting_config_exclusions/&lt;node_name&gt;</code><br></p>
<p><code class="literal">DELETE _cluster/voting_config_exclusions</code></p>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="voting-config-exclusions-api-desc"></a>Description<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/cluster/voting-exclusions.asciidoc">edit</a>
</h3>
</div></div></div>
<p>By default, if there are more than three master-eligible nodes in the cluster
and you remove fewer than half of the master-eligible nodes in the cluster at
once, the <a class="xref" href="modules-discovery-voting.html" title="Voting configurations">voting configuration</a> automatically
shrinks.</p>
<p>If you want to shrink the voting configuration to contain fewer than three nodes
or to remove half or more of the master-eligible nodes in the cluster at once,
you must use this API to remove departed nodes from the voting configuration
manually. It adds an entry for that node in the voting configuration exclusions
list. The cluster then tries to reconfigure the voting configuration to remove
that node and to prevent it from returning.</p>
<p>If the API fails, you can safely retry it.  Only a successful response
guarantees that the node has been removed from the voting configuration and will
not be reinstated.</p>
<div class="note admon">
<div class="icon"></div>
<div class="admon_content">
<p>Voting exclusions are required only when you remove at least half of the
master-eligible nodes from a cluster in a short time period. They are not
required when removing master-ineligible nodes or fewer than half of the
master-eligible nodes.</p>
</div>
</div>
<p>For more information, see <a class="xref" href="add-elasticsearch-nodes.html#modules-discovery-removing-nodes" title="Removing master-eligible nodes">Removing master-eligible nodes</a>.</p>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="voting-config-exclusions-api-path-params"></a>Path parameters<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/cluster/voting-exclusions.asciidoc">edit</a>
</h3>
</div></div></div>
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<code class="literal">&lt;node_name&gt;</code>
</span>
</dt>
<dd>
A <a class="xref" href="cluster.html#cluster-nodes" title="Node specification">node filter</a> that identifies Elasticsearch nodes.
</dd>
</dl>
</div>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="voting-config-exclusions-api-query-params"></a>Query parameters<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/cluster/voting-exclusions.asciidoc">edit</a>
</h3>
</div></div></div>
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<code class="literal">cluster.auto_shrink_voting_configuration</code>
</span>
</dt>
<dd>
(Optional, boolean) If <code class="literal">false</code>, you must use this API to maintain the voting
configuration. Defaults to <code class="literal">true</code>.
</dd>
<dt>
<span class="term">
<code class="literal">cluster.max_voting_config_exclusions</code>
</span>
</dt>
<dd>
(Optional, integer) Limits the size of the voting configuration exclusion
list. The default value is <code class="literal">10</code>. Since voting configuration exclusions are
persistent and limited in number, you must clear the voting config
exclusions list once the exclusions are no longer required.
</dd>
</dl>
</div>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="voting-config-exclusions-api-example"></a>Examples<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/cluster/voting-exclusions.asciidoc">edit</a>
</h3>
</div></div></div>
<p>Add <code class="literal">nodeId1</code> to the voting configuration exclusions list:</p>
<div class="pre_wrapper lang-console">
<pre class="programlisting prettyprint lang-console">POST /_cluster/voting_config_exclusions/nodeId1</pre>
</div>
<div class="console_widget" data-snippet="snippets/1424.console"></div>
<p>Remove all exclusions from the list:</p>
<div class="pre_wrapper lang-console">
<pre class="programlisting prettyprint lang-console">DELETE /_cluster/voting_config_exclusions</pre>
</div>
<div class="console_widget" data-snippet="snippets/1425.console"></div>
</div>

</div>
<div class="navfooter">
<span class="prev">
<a href="tasks.html">« Task management API</a>
</span>
<span class="next">
<a href="ccr-apis.html">Cross-cluster replication APIs »</a>
</span>
</div>
</div>

                  <!-- end body -->
                        </div>
                        <div class="col-xs-12 col-sm-4 col-md-4" id="right_col">
                        
                        </div>
                    </div>
                </div>
            </section>
        </div>
    </section>
</div>
<script src="../static/cn.js"></script>
</body>
</html>